/*********************************************************
@file

@author J. Di Mattina

@brief Interface for c-realize library utilities.

This file describes the interface for the c-realize 
utilities library. 
*********************************************************/
#ifndef CRZ_UTILS_H
#define CRZ_UTILS_H

#ifdef __cplusplus
extern "C"
{
#endif

/* standard library includes */
#include <stdint.h>

/* local includes */
#include "Crz_Types.h"

/*********************************************************
 Crz_isBigEndian
*//**
@brief Checks the host machine for endian-ness

@return CRZ_TRUE if the host is a big-endian machine
        CRZ_FALSE otherwise
**********************************************************/
Crz_Bool
Crz_isBigEndian();

/*********************************************************
 Crz_hton16
*//**
@brief Converts a 16 bit integer to network order.

@param [in] val 16-bit value

@return 16 bit-integer in network order.
**********************************************************/
uint16_t
Crz_hton16(uint16_t val);

/*********************************************************
 Crz_hton32
*//**
@brief Converts a 32 bit integer to network order.

@param [in] val 32-bit value

@return 32 bit-integer in network order.
**********************************************************/
uint32_t
Crz_hton32(uint32_t val);

/*********************************************************
 Crz_hton64
*//**
@brief Converts a 64 bit integer to network order.

@param [in] val 64-bit value

@return 64 bit-integer in network order.
**********************************************************/
uint64_t
Crz_hton64(uint64_t val);

/*********************************************************
 Crz_ntoh16
*//**
@brief Converts a 16 bit integer to host order.

@param [in] val 16-bit value

@return 16 bit-integer in host order.
**********************************************************/
uint16_t
Crz_ntoh16(uint16_t val);

/*********************************************************
 Crz_ntoh32
*//**
@brief Converts a 32 bit integer to host order.

@param [in] val 32-bit value

@return 32 bit-integer in host order.
**********************************************************/
uint32_t
Crz_ntoh32(uint32_t val);

/*********************************************************
 Crz_hton64
*//**
@brief Converts a 64 bit integer to host order.

@param [in] val 64-bit value

@return 64 bit-integer in host order.
**********************************************************/
uint64_t
Crz_ntoh64(uint64_t val);

#ifdef __cplusplus
}
#endif

#endif /* CRZ_UTILS_H */
